#ifndef __INTERRUPT_H__
#define __INTERRUPT_H__

#include  "stm32mp1xx_gpio.h"
#include "stm32mp1xx_rcc.h"
#include "stm32mp1xx_exti.h"
#include "stm32mp1xx_gic.h"

typedef enum {
    EXTI0_INPUT_EVENT = 0,
    EXTI1_INPUT_EVENT,
    EXTI2_INPUT_EVENT,
    EXTI3_INPUT_EVENT,
    EXTI4_INPUT_EVENT,
    EXTI5_INPUT_EVENT,
    EXTI6_INPUT_EVENT,
    EXTI7_INPUT_EVENT,
    EXTI8_INPUT_EVENT,
    EXTI9_INPUT_EVENT,
    EXTI10_INPUT_EVENT,
    EXTI11_INPUT_EVENT,
    EXTI12_INPUT_EVENT,
    EXTI13_INPUT_EVENT,
    EXTI14_INPUT_EVENT,
    EXTI15_INPUT_EVENT,
}input_event_t;

typedef enum {
    RISING = 0,
    FALLING,
} edge_trigger_select_t;

#define    PA     0
#define    PB     1
#define    PC     2
#define    PD     3
#define    PE     4
#define    PF     5
#define    PG     6
#define    PH     7

#define    EXTI9_ID     99
#define    EXTI9_PRI    5

#define    EXTI5_ID     55
#define    EXTI5_PRI    3

#define    TIM5_ID      82
#define    TIM5_PRI     2


void hal_exti_IT_init(input_event_t inputEvent, unsigned int gpioGroup, edge_trigger_select_t edge);
void hal_exti_IT_clear(input_event_t inputEvent, edge_trigger_select_t edge);


void hal_gic_IT_init(unsigned int id, unsigned int pri); 
void hal_gic_IT_clear(unsigned int id); 

#endif